<%@page import="tx.bjdacp.model.*" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib tagdir="/WEB-INF/tags/simpletable" prefix="simpletable"%>
<%@ include file="/commons/taglibs.jsp" %>

<rapid:override name="head">
	<title><%=BasicDrug.TABLE_ALIAS%> 维护</title>

	<link href="<c:url value="/widgets/simpletable/simpletable.css"/>" type="text/css" rel="stylesheet">
	<script type="text/javascript" src="<c:url value="/widgets/simpletable/simpletable.js"/>"></script>

	<script type="text/javascript" >
		$(document).ready(function() {
			// 分页需要依赖的初始化动作
			window.simpleTable = new SimpleTable('queryForm',${page.thisPageNumber},${page.pageSize},'${pageRequest.sortColumns}');
		});
	</script>
</rapid:override>

<rapid:override name="content">
	<form id="queryForm" name="queryForm" action="<c:url value="/pages/BasicDrug/list.do"/>" method="post" style="display: inline;">
	<div class="queryPanel">
		<fieldset>
			<legend>搜索</legend>
			<table>
				<tr>

					<td class="tdLabel"><%=BasicDrug.ALIAS_VARIETY_NAME%></td>
					<td>
						<input value="${query.varietyName}" id="varietyName" name="varietyName" maxlength="100"  class=""/>
					</td>
					<td class="tdLabel"><%=BasicDrug.ALIAS_DOSAGE_FORM%></td>
					<td>
						<input value="${query.dosageForm}" id="dosageForm" name="dosageForm" maxlength="100"  class=""/>
					</td>
					<td class="tdLabel"><%=BasicDrug.ALIAS_SPEC%></td>
					<td>
						<input value="${query.spec}" id="spec" name="spec" maxlength="100"  class=""/>
					</td>
				</tr>
				<tr>
					<td class="tdLabel"><%=BasicDrug.ALIAS_PRODUCING_AREA%></td>
					<td>
						<input value="${query.producingArea}" id="producingArea" name="producingArea" maxlength="100"  class=""/>
					</td>
					<td class="tdLabel"><%=BasicDrug.ALIAS_SELL_UNIT%></td>
					<td>
						<input value="${query.sellUnit}" id="sellUnit" name="sellUnit" maxlength="100"  class=""/>
					</td>
					<td class="tdLabel"><%=BasicDrug.ALIAS_REMARK%></td>
					<td>
						<input value="${query.remark}" id="remark" name="remark" maxlength="1000"  class=""/>
					</td>
					<td class="tdLabel"><%=BasicDrug.ALIAS_DRUG_KIND%></td>
					<td>
						<input value="${query.drugKind}" id="drugKind" name="drugKind" maxlength="100"  class=""/>
					</td>
				</tr>
			</table>
		</fieldset>
		<div class="handleControl">
			<input type="submit" class="stdButton" style="width:80px" value="查询" onclick="getReferenceForm(this).action='${ctx}/pages/BasicDrug/list.do'"/>
			<input type="submit" class="stdButton" style="width:80px" value="新增" onclick="getReferenceForm(this).action='${ctx}/pages/BasicDrug/create.do'"/>
			<input type="button" class="stdButton" style="width:80px" value="删除" onclick="batchDelete('${ctx}/pages/BasicDrug/delete.do','items',document.forms.queryForm)"/>
		<div>
	</div>

	<div class="gridTable">

		<simpletable:pageToolbar page="${page}">
		</simpletable:pageToolbar>

		<table width="100%"  border="0" cellspacing="0" class="gridBody">
		  <thead>

			  <tr>
				<th style="width:1px;"> </th>
				<th style="width:1px;"><input type="checkbox" onclick="setAllCheckboxState('items',this.checked)"></th>

				<!-- 排序时为th增加sortColumn即可,new SimpleTable('sortColumns')会为tableHeader自动增加排序功能; -->
				<th sortColumn="variety_name" ><%=BasicDrug.ALIAS_VARIETY_NAME%></th>
				<th sortColumn="dosage_form" ><%=BasicDrug.ALIAS_DOSAGE_FORM%></th>
				<th sortColumn="spec" ><%=BasicDrug.ALIAS_SPEC%></th>
				<th sortColumn="producing_area" ><%=BasicDrug.ALIAS_PRODUCING_AREA%></th>
				<th sortColumn="sell_unit" ><%=BasicDrug.ALIAS_SELL_UNIT%></th>
				<th sortColumn="remark" ><%=BasicDrug.ALIAS_REMARK%></th>
				<th sortColumn="drug_kind" ><%=BasicDrug.ALIAS_DRUG_KIND%></th>

				<th>操作</th>
			  </tr>

		  </thead>
		  <tbody>
		  	  <c:forEach items="${page.result}" var="item" varStatus="status">

			  <tr class="${status.count % 2 == 0 ? 'odd' : 'even'}">
				<td>${page.thisPageFirstElementNumber + status.index}</td>
				<td><input type="checkbox" name="items" value="basicDrugId=${item.basicDrugId}&"></td>

				<td><c:out value='${item.varietyName}'/>&nbsp;</td>
				<td><c:out value='${item.dosageForm}'/>&nbsp;</td>
				<td><c:out value='${item.spec}'/>&nbsp;</td>
				<td><c:out value='${item.producingArea}'/>&nbsp;</td>
				<td><c:out value='${item.sellUnit}'/>&nbsp;</td>
				<td><c:out value='${item.remark}'/>&nbsp;</td>
				<td><c:out value='${item.drugKind}'/>&nbsp;</td>
				<td>
					<a href="${ctx}/pages/BasicDrug/show.do?basicDrugId=${item.basicDrugId}&">查看</a>&nbsp;&nbsp;&nbsp;
					<a href="${ctx}/pages/BasicDrug/edit.do?basicDrugId=${item.basicDrugId}&">修改</a>
				</td>
			  </tr>

		  	  </c:forEach>
		  </tbody>
		</table>

		<simpletable:pageToolbar page="${page}">
		</simpletable:pageToolbar>
	</div>
	</form>
</rapid:override>

<%-- jsp模板继承,具体使用请查看: http://code.google.com/p/rapid-framework/wiki/rapid_jsp_extends --%>
<%@ include file="base.jsp" %>

